<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <link rel="stylesheet" type="text/css" href="/Xqkq/Public/Libs/easyui/themes/bootstrap/easyui.css">
<link rel="stylesheet" type="text/css" href="/Xqkq/Public/Libs/easyui/themes/icon.css">
<link rel="stylesheet" type="text/css" href="/Xqkq/Public/Libs/easyui/themes/color.css">
<script type="text/javascript" src="/Xqkq/Public/Libs/easyui/jquery.min.js"></script>
<script type="text/javascript"   src="/Xqkq/Public/Libs/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript"   src="/Xqkq/Public/Libs/easyui/locale/easyui-lang-zh_CN.js"></script>



<!-- Plupload 引入文件 -->
<link rel="stylesheet" href="/Xqkq/Public/Libs/plupload/jquery.plupload.queue/css/jquery.plupload.queue.css" type="text/css" media="screen" />
<script type="text/javascript" src="/Xqkq/Public/Libs/plupload/plupload.full.min.js"></script>
<script type="text/javascript" src="/Xqkq/Public/Libs/plupload/jquery.plupload.queue/jquery.plupload.queue.js"></script>
    <link rel="stylesheet" type="text/css" href="/Xqkq/Public/Admin/css/init.css">
</head>

<body>

    <div class="easyui-tabs" style="width:100%;">

        <div title="用户管理" style="padding:10px">
        <table id="user" class="easyui-datagrid" title="用户列表" style="width:100%;"
            data-options="singleSelect:true,pagination:true,collapsible:false,url:'/Xqkq/admin.php/User/get_user',method:'post'"
            toolbar="#tb"
            fitColumns="true">
            <thead>
                <tr>
                    <th data-options="field:'id',width:50">ID</th>
                    <th data-options="field:'photo',width:50,formatter:imgformat">用户头像</th>
                    <th data-options="field:'nickname',width:100">用户昵称</th>
                    <th data-options="field:'phone',width:100">电话号码</th>
                    <th data-options="field:'email',width:100">电子邮箱</th>
                    <th data-options="field:'score',width:100">用户积分</th>
                    <th data-options="field:'rtime',width:100">注册时间</th>
                    <th data-options="field:'state',width:100,formatter:stateformat">用户状态</th>
                </tr>
            </thead>
        </table>
        <div id="tb" style="padding:2px;">
            <p style="margin: 4px;">
                <button class="easyui-linkbutton" plain="true" iconCls="icon-edit" onclick="edit_row('user','dlg','fm','/Xqkq/admin.php/User/edit')">编辑用户</button>
                <button class="easyui-linkbutton" plain="true" iconCls="icon-delete" onclick="">使用记录</button>
            </p>
        </div>
        </div>

    </div>

<!--  用户编辑 Dialog  -->
<div id="dlg" class="easyui-dialog" style="width:330px;height:300px;padding:10px 0px;"
closed="true" buttons="#dlg-buttons">
    <form id="fm" method="post" novalidate>
        <div class="fitem">
            <label>用户昵称:</label>
            <input name="nickname" class="easyui-textbox" required="true">
        </div>
        <div class="fitem">
            <label>电话号码:</label>
            <input name="phone" class="easyui-textbox" disabled="disabled">
        </div>
        <div class="fitem">
            <label>电子邮箱:</label>
            <input name="email" class="easyui-textbox">
        </div>
        <div class="fitem">
            <label>用户积分:</label>
            <input name="score" class="easyui-numberbox">
        </div>
        <div class="fitem">
            <label>登录密码:</label>
            <input name="password" type="password" class="easyui-textbox">
        </div>
        <div class="fitem">
            <label>用户状态:</label>
            <select name="state" class="easyui-combobox" >
                <option value="1">正常</option>
                <option value="0">拉黑</option>
            </select>
        </div>
    </form>
</div>
<div id="dlg-buttons">
    <button class="easyui-linkbutton c6" iconCls="icon-ok" onclick= "submit_form('user','fm','dlg');" style="width:90px">保存</button>
    <button class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#dlg').dialog('close')" style="width:90px">返回</button>
</div>

<script type="text/javascript" src="/Xqkq/Public/Admin/js/common.ajax.js"></script>
<script>
function stateformat(val,row) {
    if (val == 1)
        return "<span style='color:green; font-weight:bold;'>正常</span>"
    return "<span style='color:red; font-weight:bold;'>拉黑</span>"
}
</script>


</body>
</html>